<template>
  <div class="errPage-container">
    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="姓名">
        <el-input v-model="form.name" size="medium" placeholder="请输入姓名" style="width:200px" />
      </el-form-item>
      <el-form-item label="手机号码">
        <el-input v-model="form.phone" size="medium" placeholder="请输入手机号码" style="width:200px" />
      </el-form-item>
      <el-form-item label="用户名">
        <el-input v-model="form.user" size="medium" placeholder="请输入用户名" style="width:200px" />
      </el-form-item>
      <el-button style="height:36px;margin-left:20px">搜索</el-button>
      <el-button style="height:36px">重置</el-button>
    </el-form>
    <el-row class="el-row">
      <el-button
        type="primary"
        style="margin-bottom:10px;margin-left:20px"
        @click="dialogFormVisible = true"
      >+新增</el-button>
    </el-row>
    <el-card>
      <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="date" label="姓名" width="180" />
        <el-table-column prop="name" label="用户名" width="180" />
        <el-table-column prop="address" label="角色" />
        <el-table-column prop="address" label="手机号" />
        <el-table-column prop="address" label="状态" />
        <el-table-column label="操作">
          <el-button type="text" @click="dialogFormVisible = true">修改</el-button>
          <el-button type="text">启用</el-button>
          <el-button type="text">删除</el-button>
        </el-table-column>
      </el-table>
      <div class="block">
        <el-pagination
          layout="total, sizes, prev, pager, next, jumper"
          :page-sizes="[100, 200, 300, 400]"
          :page-size="100"
          :current-page="currentPage4"
          :total="400"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
        />
      </div>
    </el-card>
    <el-dialog title="收货地址" :visible.sync="dialogFormVisible">
      <el-form :model="form">
        <el-form-item label="活动名称" :label-width="formLabelWidth">
          <el-input v-model="form.name" autocomplete="off" />
        </el-form-item>
        <el-form-item label="活动区域" :label-width="formLabelWidth">
          <el-select v-model="form.region" placeholder="请选择活动区域">
            <el-option label="区域一" value="shanghai" />
            <el-option label="区域二" value="beijing" />
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      form: {
        name: ' ',
        phone: ' ',
        user: '',
        pageNum: '',
        pageSize: ''
      },
      tableData: [
        {
          name: '123'
        }
      ],
      dialogFormVisible: false,
      currentPage4: 4,
      formLabelWidth: '120px'
    }
  },
  created() {
    this.getData()
  },
  methods: {
    handleEdit(index, row) {
      console.log(index, row)
    },
    handleDelete(index, row) {
      console.log(index, row)
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`)
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`)
    }
  }
}
</script>
<style lang="scss" scope>
.errPage-container {
  margin-top: 10px;
  width: 100%;
  height: 100%;
  .el-form {
    display: flex;
  }
  el-dialog{
    width:100%;
  }
}
</style>